home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
dvglue10.arc
/
TVFWRITE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-08-13
|
1KB
|
44 lines
/*=======================================================*/
/* TVFWRITE.C */
/* */
/* (c) Copyright 1988 Ralf Brown All Rights Reserved */
/* May be freely copied for noncommercial use, so long */
/* as this copyright notice remains intact, and any */
/* changes are marked in the comment blocks preceding */
/* functions. */
/*=======================================================*/
#include <string.h>
#include "tvapi.h"
#include "tvstream.h"
/*=============================================*/
/* TVfld_write write characters into field */
/* Ralf Brown 4/5/88 */
/*=============================================*/
int pascal TVfld_write(OBJECT win,int field,char *s)
{
char *dest ;
int size = TVqry_fieldsize(win,field) ;
BYTE *stream = (BYTE *)malloc(size+6) ;
if (stream)
{
stream[0] = 0x1B ;
stream[1] = 0x00 ;
*((int *)(stream+2)) = size + 2 ;
stream[4] = 0xF3 ;
stream[5] = field ;
dest = (char *)stream+6 ;
while (size--)
*dest++ = *s++ ;
TVwin_stream(win,stream) ;
free(stream) ;
return TRUE ;
}
else
return FALSE ;
}
/* End of TVFWRITE.C */